//
//  HJAppInfo.m
//  KaiChat
//
//  Created by lx on 2023/10/17.
//

#import "HJAppInfo.h"
#import <UIKit/UIKit.h>

BOOL isIPhoneX(void) {
    if (@available(iOS 11.0, *)) {
        CGFloat height = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom;
        return (height > 0);
    } else {
        return NO;
    }
}

NSString *getAppVersion(void) {
    NSDictionary *infoDictionary = [NSBundle.mainBundle infoDictionary];
    return infoDictionary[@"CFBundleShortVersionString"];
}

NSString *getAppName(void) {
    NSDictionary *infoDictionary = [NSBundle.mainBundle infoDictionary];
    return infoDictionary[@"CFBundleDisplayName"];
}

NSString *getAppBundleIdentifier(void) {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
}
 
NSString *getBaseDomains(void) {
    return @"test-api-ai.ai-chat.ltd";
}

NSString *getBaseUrlString(void) {
    return [NSString stringWithFormat:@"http://%@", getBaseDomains()];
}

NSString *getUserAgent(void) {
    return [NSString stringWithFormat:@"Mozilla/5.0 %@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
}
 
 
BOOL isProduction(void) {
    return YES;

//    if ([getAppBundleIdentifier() isEqualToString:@"com.xwy.netWorkCloudTest"]) {
//        return NO;
//    } else {
//        return YES;
//    }
}
 

NSString *getLocaleIdentifier(void) {
    return @"en_US";
}

//dd MMM yyyy HH:mm
//yyyy-MM-dd HH:mm

NSString *getYYMMDDDate(void) {
    return @"en_US";
}

NSString *getMMDDDate(void) {
    return @"MMMM d";
}


